package org.dse.util;

import org.dse.proc.RawHtmlDocumentManager;

/**
 * This class is the entrance of the system, containing the main method.
 * 
 * @author zhangchen
 * 
 */
public class Main {

	/**
	 * @param args
	 *            If the arg is given, the task file is the arg. Else, use
	 *            default task file.
	 */
	public static void main(String[] args) {
		String taskFile;

		if (args.length != 0)
			taskFile = args[0];
		else
			taskFile = Constants.TASK_FILE;

		/* Use application context to get the most important bean. */
		RawHtmlDocumentManager manager = (RawHtmlDocumentManager) ApplicationContextUtil
				.getBean("RawHtmlDocumentManager");
		long start = System.currentTimeMillis();
		manager.indexFiles(taskFile);
		System.out
				.println(((double) System.currentTimeMillis() - start) / 1000);
	}
}
